#pragma once

#include <DirectXMath.h>
#include <cstring>

namespace D3D10Utils 
{
    // Note: Make sure structure alignment agrees with HLSL structure padding rules. 
    // Elements are packed into 4D vectors with the restriction that an element
    // cannot straddle a 4D vector boundary.

    struct DirectionalLight
    {
	    __forceinline DirectionalLight();

	    DirectX::XMFLOAT4A mAmbientColor;
	    DirectX::XMFLOAT4A mDiffuseColor;
	    DirectX::XMFLOAT4A mSpecularColor;
	    DirectX::XMFLOAT3A mDirection;
    };

    DirectionalLight:: DirectionalLight()
    {
        memset(this, 0, sizeof(DirectionalLight));
    }  

    struct PointLight
    {
	    __forceinline PointLight();

	    DirectX::XMFLOAT4A mAmbientColor;
	    DirectX::XMFLOAT4A mDiffuseColor;
	    DirectX::XMFLOAT4A mSpecularColor;

	    DirectX::XMFLOAT3A mPosition;
	    float mRange;

	    DirectX::XMFLOAT3A mAttenuation;
    };

    PointLight:: PointLight()
    {
        memset(this, 0, sizeof(PointLight)); 
    } 

    struct SpotLight
    {
	    __forceinline SpotLight();

	    DirectX::XMFLOAT4A mAmbientColor;
	    DirectX::XMFLOAT4A mDiffuseColor;
	    DirectX::XMFLOAT4A mSpecularColor;

	    DirectX::XMFLOAT3A mPosition;
	    float mRange;

	    DirectX::XMFLOAT3A mDirection;
	    float mSpotFactor;

	    DirectX::XMFLOAT3A mAttenuation;
    };

    SpotLight:: SpotLight()
    {
        memset(this, 0, sizeof(SpotLight));
    } 	
}
